/* ORG CHART - HIERARCHICAL */
.org-chart {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px; /* increased top spacing */
  position: relative;
}

/* BRANCH (ROW OF NODES) */
.org-branch {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px; /* increase horizontal gap between nodes */
  position: relative;
  margin-top: 30px; /* vertical space between parent and child branch */
}

/* EACH NODE */
.org-node {
  background: #44ad44;
  color: white;
  padding: 15px 20px; /* slightly bigger padding for spacing */
  border-radius: 8px;
  text-align: center;
  min-width: 200px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  transition: transform 0.3s, background 0.3s;
  position: relative;
  margin-bottom: 20px; /* space below node for connector */
}

.org-node:hover {
  transform: scale(1.05);
  background: #379837;
}

/* TEAM MEMBER NAME */
.team-member {
  display: block;
  font-size: 14px;
  margin-top: 8px; /* more spacing from role title */
  color: #d1d5db;
}

/* CONNECTOR LINES */
.org-node::before,
.org-node::after {
  content: "";
  position: absolute;
  border-left: 2px solid #999;
}

.org-node::before {
  top: -30px; /* increase space above node */
  left: 50%;
  height: 30px; /* taller vertical line */
  transform: translateX(-50%);
}

.org-branch > .org-node:not(:first-child)::before {
  border-left: none;
}

.org-branch::before {
  content: "";
  position: absolute;
  top: -15px; /* shift horizontal connector slightly above child nodes */
  left: 0;
  right: 0;
  height: 2px;
  background: #999;
}

/* RESPONSIVE */
@media(max-width:768px){
  .org-branch {
    flex-direction: column;
    margin-top: 20px;
  }
  .org-node {
    min-width: 150px;
    margin: 15px 0; /* vertical spacing for stacked nodes */
  }
  .org-node::before {
    height: 25px;
    top: -25px;
  }
  .org-branch::before {
    top: -12px;
  }
}